package org.spark.sparkUtil;

import org.apache.commons.lang.StringUtils;
import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;

/**
 * @author 某人的目光
 * @date 2020/5/17 20:16
 */
public class SparkJavaContextUtil {
    public static JavaSparkContext getSparkStart(String appName) {
        // 创建SparkConf
        SparkConf conf = new SparkConf()
                .setAppName(appName)
                .setMaster("local");
        // 创建JavaSparkContext
        JavaSparkContext sc = new JavaSparkContext(conf);
        return sc;
    }
}
